package com.jvmoutofmemory.platform.pushutil.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by Administrator on 2017/6/8 0008.
 */
@Table(name = "push_job")
@Getter
@Setter
@ToString
public class PushJob implements Serializable{

	private static final long serialVersionUID = 1L;

    public static final int CALLBACK_SUCCESS = 1;
    public static final int CALLBACK_FAILED = 0;

	@Id
    @Column(name = "id", columnDefinition = "主键")
    private Long id;

    @Column(name = "url", columnDefinition = "请求路径")
    private String url;

    @Column(name = "param", columnDefinition = "请求参数")
    private String param;

    @Column(name = "param_type", columnDefinition = "参数类型：1.json、2.表单")
    private Short paramType;

    @Column(name = "method", columnDefinition = "请求方式：1.get、2.post")
    private Short method;

    @Column(name = "status", columnDefinition = "状态：0.尚未请求、1.请求失败、2请求成功")
    private Short status;

    @Column(name = "times", columnDefinition = "请求次数")
    private Integer times;

    @Column(name = "max_retry", columnDefinition = "重试次数")
    private Integer maxRetry;

    @Column(name = "msg", columnDefinition = "备注信息")
    private String msg;

    @Column(name = "create_time", columnDefinition = "创建时间")
    private Date createTime;

    @Column(name = "update_time", columnDefinition = "更新时间")
    private Date updateTime;

    @Column(name = "request_id", columnDefinition = "请求id")
    private String requestId;

    @Column(name = "external_info", columnDefinition = "其他信息")
    private String externalInfo;

    @Column(name = "sys_type", columnDefinition = "系统类型：SubStationUrlType枚举名")
    private String sysType;

    @Column(name = "listener", columnDefinition = "监听器")
    private String listener;
    
    @Column(name="call_back_param", columnDefinition = "回调参数")
    private String callBackParam;
    
    @Column(name="call_back_type", columnDefinition = "回调参数类型")
    private String callBackType;

    @Column(name="call_back_status", columnDefinition = "回调状态,0失败，1成功")
    private Integer callbackStatus;

    @Column(name="call_back_times", columnDefinition = "回调次数")
    private Integer callbackTimes;

    @Column(name="push_rid", columnDefinition = "推送id")
    private String pushRid;

}
